package server

import (
	"TodoList/controler"
	"github.com/gin-gonic/gin"
)

// NewRouter 路由配置
func NewRouter() *gin.Engine {
	r := gin.Default()
	// 路由
	v1 := r.Group("/api")
	{
		v1.POST("/todo", controler.Add)
		v1.PUT("/todo", controler.Update)
		v1.DELETE("/todo", controler.Delete)
		v1.GET("/todo", controler.GetList)
	}
	return r
}
